package com.shiyi.configs;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * 可以通过@Configuration和实现WebMvcConfigurer加入自定义的MVC特性
 *
 * 比如interceptors, formatters, view controllers...
 * @author qiu
 * @date 2021-03-04 下午 09:50
 * @since 1.0
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/view").setViewName("hello");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
    }

}
